package Servlet;

import java.io.IOException;
import java.util.HashMap;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.bookDao;

public class InitServlet extends HttpServlet{
	public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{
		System.out.print("hello");
		bookDao bdao=new bookDao();
		HashMap allbook=null;
		try{
			allbook=bdao.getAllBook();			
		}catch(Exception e)
		{
			e.printStackTrace();
		}
		request.getSession().setAttribute("allbook", allbook);
		response.sendRedirect("/Proj3/showAllBook.jsp");
	}

}
